package com.attendance.config;

import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

/**
 * Created by inuyasha on 2016/11/17.
 */
@Configuration
@ComponentScan
public class MyConfiguration extends WebMvcConfigurerAdapter {

    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
//        registry.addResourceHandler("/js/**")
//                .addResourceLocations("classpath:/js/");
//        registry.addResourceHandler("/css/**")
//                .addResourceLocations("classpath:/css/");
//        registry.addResourceHandler("/WEB-INF/resources/image/**")
//                .addResourceLocations("classpath:/image/");
//        registry.addResourceHandler("/static/**")
//                .addResourceLocations("classpath:/html/");
//        registry.addResourceHandler("/**").addResourceLocations("/");
    }

    @Override
    public void addViewControllers(ViewControllerRegistry registry) {
        registry.addViewController("/").setViewName("/html/index.html");
    }
}
